import React, {useEffect} from 'react';
import Li from './li';
import {connect} from 'react-redux'

const Todos = (props) => {
  const {data, dispatch} = props;
  return (
    <ul id="todo-list">
      {
        data.map(item => <Li key={item.id} data={item} />)
      }
    </ul>
  )
}

export default connect((state, props) => {
  return {
    ...props,
    data: [...state.data]
  }
})(Todos);
